package com.zzpct.wh.work.shucheng.ui.notifications;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;

import com.zzpct.wh.work.shucheng.R;

public class NotificationsFragment extends Fragment {
    private TextView usertxt;

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_notifications, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        usertxt = view.findViewById(R.id.usertxt);
        SharedPreferences sp = getActivity().getSharedPreferences("userinfo", Context.MODE_PRIVATE);
        int uid = sp.getInt("userid", -1);
        String usn=sp.getString("username","");
        usertxt.setText("你好," + uid + "号用户" + usn);
    }
}